<!-- 会员中心主内容区 -->
<div class="page-article">
  <!-- 预存款充值 -->

  <div id="member_prepaid" class="member-prepaid">
  <div class="member-tabs">
      <a href="<{link app=aftersales ctl=site_member act=go_billing}>" class="active"><em><{t}>开票信息<{/t}></em></a>
      <a href="<{link app=aftersales ctl=site_member act=apply_billing}>"><em><{t}>开票记录<{/t}></em></a>
    </div>

    <div class="member-mod">
    <iframe src="about:blank" name="upload" frameborder="0" class="hide"></iframe>
      <form action="<{link app=aftersales ctl=site_member act=to_billing }>" method="post" target="upload">
        <input type="hidden" name="member_id" value="<{$member_id}>" />
        <!-- <input type="hidden" name="return_url" value="<{$return_url}>" /> -->
        <table>
          <col width="150">
          <tbody>
            <tr>
            &nbsp;&nbsp;<span style="color:;">温馨提示:</span> <span style="color:;">订单金额累计满5000元可申请开票</span>
              <td><{t}>发票类型<{/t}>：</td>
              <td>

              <span class="tab-nav " name="" value="" id="putong" onclick="putong();"><input type="checkbox" id="putongId" name="putong" value="普通发票" style="opacity:0"/> <{t}>普通发票<{/t}></span>
              <span class="tab-nav tab-nav-selected" id="zhuanyong" onclick="zhuanyong();"><input type="checkbox" id="danziId"  name="zhuanyong" checked value="专用发票" style="opacity:0"/><{t}>专用发票<{/t}></span>
              <!-- <input type="text" name="billing_money" id="" class="x-input" size="10" vtype="required&&positive" data-caution="<{t}>请输入开票金额<{/t}>&&<{t}>金额只能是大于0的数字<{/t}>"> -->
              </td>
            </tr>
            <tr>
              <tr>
              <td><{t}>发票抬头<{/t}>：</td>
              <td><!--  <input type="text" name="content" class="x-input" placeholder="<{t}>描述申请理由<{/t}>" vtype="required" data-caution="<{t}>请填写申请理由<{/t}>"> -->
              <span class="tab-nav "  id="positive"onclick="positive();">
              <input type="checkbox" name="positive" value="个人" style="opacity:0"/>
              <{t}>个人<{/t}></span>
              <span class="tab-nav tab-nav-selected"  id="danwei" onclick="danwei();">
              <input type="checkbox" name="danwei" checked value="单位" style="opacity:0"/>
              <{t}>单位<{/t}></span>

              </td>
            </tr>
            <tr class="items ">

              <td id="company_name"><{t}>单位名称<{/t}>：</td>

              <td><input type="text" class="items-naving " id="company_nameId"  name="company_name" value="" vtype="required" data-caution="<{t}>请填写单位名称<{/t}>"/></td>
            </tr>
             <tr class="items ">

              <td id="company_name"><{t}>开票金额<{/t}>：</td>

            <!--   <td><input type="text" class="items-naving " id="orderDiv" onclick="orderId(<{$member_id}>);" name="order_id" value="" vtype="required" data-caution="<{t}>开票订单<{/t}>"/>
              </td> -->
              <td><input type="text" class="items-naving" id="billing_money" name="billing_money" vtype="required" data-caution="<{t}>请填写开票金额<{/t}>"/></td>
            </tr>
            <tr id="EleId" class="items ">

              <td><{t}>纳税人识别号<{/t}>：</td><br/>

              <td><input type="text" class="items-naving " id="companyDivId"  onclick="companyDiv(<{$member_id}>);" name="company_taxpayer" value="" vtype="required" data-caution="<{t}>请填写纳税人识别码<{/t}>"/></td>
            </tr>

            <tr>
              <td><{t}>发票内容<{/t}>：</td>
              <td>
                <ul>
                  <li class="tab-nav tab-nav-selected" name="company_taxpayer" id="fapiao1" value="商品明细" onclick="fapiao1();">
                   <input type="checkbox" name="content" checked value="商品明细" style="opacity:0"/>
                  <{t}>商品明细<{/t}>&nbsp;&nbsp;</li>
                <!--   <li class="tab-nav " id="fapiao2" onclick="fapiao2();">文具&nbsp;&nbsp;</li>
                  <li class="tab-nav " id="fapiao3" onclick="fapiao3();">电脑配件&nbsp;&nbsp;</li>
                  <li class="tab-nav" id="fapiao4" onclick="fapiao4();">耗材&nbsp;&nbsp;</li><br/>
                  <li class="tab-nav " id="fapiao5" onclick="fapiao5();">食品酒水&nbsp;&nbsp;</li>

                  <li class="tab-nav" id="fapiao6" onclick="fapiao6();">服装鞋帽&nbsp;&nbsp;</li>
                  <li class="tab-nav" id="fapiao7" onclick="fapiao7();">日用品&nbsp;&nbsp;</li><br/>

                  <li class="tab-nav" id="fapiao8" onclick="fapiao8();">电器数码&nbsp;&nbsp;</li>

                  <li class="tab-nav" id="fapiao9" onclick="fapiao9();">家居建材&nbsp;&nbsp;</li>
                  <li class="tab-nav" id="fapiao10" onclick="fapiao10();">钟表珠宝&nbsp;&nbsp;</li><br/>
                  <li class="tab-nav " id="fapiao11" onclick="fapiao11();">日化用品&nbsp;&nbsp;</li> -->


                </ul>
              </td>
            </tr>
            <tr id="mobileId">
              <td><{t}>收票手机号<{/t}>：</td>
              <td><input  type="text" class="items-naving "name="company_mobile" value="" vtype="required" data-caution="<{t}>请填写收票手机号<{/t}>"/></td>
            </tr>
            <tr id="emailId">
                <td><{t}>收票人邮箱<{/t}>：</td>
                <td><input type="text" class="items-naving " name="company_email" value="" vtype="required"
                           data-caution="<{t}>请填写收票人邮箱<{/t}>"/>
                </td>
            </tr>
            <tr id="billing_memo">
                <td><{t}>备注<{/t}>：</td>
                <td><input type="text" class="items-naving " name="company_memo" value=""  />
                </td>
            </tr>
            <tr>
              <td></td>
              <td>


                <button type="submit" class="btn btn-import btn-big"><span><span><{t}>去申请<{/t}></span></span></button>
              </td>
            </tr>
          </tbody>
        </table>
      </form>
    </div>
  </div>
</div>

<script>




  function putong(){
    var putong=document.getElementById("putong");
    putong.addClass('tab-nav-selected');
    var zhuanyong=document.getElementById("zhuanyong");
    zhuanyong.removeClass('tab-nav-selected');
    document.getElementById("mobileId").addClass('hide');
    document.getElementById("emailId").addClass('hide');
    document.getElementById("company_nameId").addClass('hide');
    var checkboxs=document.getElementsByName("putong");

    for (var i=0;i<checkboxs.length;i++) {
      var e=checkboxs[i];
      e.checked=true;
   }
    var checkboxs=document.getElementsByName("zhuanyong");
    for (var i=0;i<checkboxs.length;i++) {
      var e=checkboxs[i];
      e.checked=false;

    }
  }
  function zhuanyong(){
    var putong=document.getElementById("putong");
    var zhuanyong=document.getElementById("zhuanyong");
    zhuanyong.addClass('tab-nav-selected');
    putong.removeClass('tab-nav-selected');
    document.getElementById("mobileId").removeClass('hide');
    document.getElementById("emailId").removeClass('hide');
    document.getElementById("EleId").removeClass('hide');
    document.getElementById("company_name").removeClass('hide');
    var checkboxs=document.getElementsByName("putong");
    for (var i=0;i<checkboxs.length;i++) {
      var e=checkboxs[i];
      e.checked=false;

    }
    var checkboxs=document.getElementsByName("zhuanyong");
    for (var i=0;i<checkboxs.length;i++) {
      var e=checkboxs[i];
      e.checked=true;
    }
  }
  function positive(){
    var positive=document.getElementById("positive");
    // positive.style.color='#f60';
    positive.addClass('tab-nav-selected');
    var danwei=document.getElementById("danwei");
    // danwei.style.color='#000000';
    danwei.removeClass('tab-nav-selected');
    document.getElementById("EleId").addClass('hide');
    document.getElementById("company_nameId").addClass('hide');
    document.getElementById("company_name").addClass('hide');
    var checkboxs=document.getElementsByName("positive");
    for (var i=0;i<checkboxs.length;i++) {
      var e=checkboxs[i];
      e.checked=true;
   }
    var checkboxs=document.getElementsByName("danwei");
    for (var i=0;i<checkboxs.length;i++) {
      var e=checkboxs[i];
      e.checked=false;
    }
  }
  function danwei(){
    var positive=document.getElementById("positive");
    var danwei=document.getElementById("danwei");
    danwei.addClass('tab-nav-selected');
    positive.removeClass('tab-nav-selected');
    document.getElementById("EleId").removeClass('hide');
    document.getElementById("company_nameId").removeClass('hide');
    document.getElementById("company_name").removeClass('hide');
    document.getElementById("EleId").addClass('item');
    var checkboxs=document.getElementsByName("positive");
    for (var i=0;i<checkboxs.length;i++) {
      var e=checkboxs[i];
      e.checked=false;
   }
    var checkboxs=document.getElementsByName("danwei");
    for (var i=0;i<checkboxs.length;i++) {
      var e=checkboxs[i];
      e.checked=true;
    }
  }
  function fapiao1(){
    var fapiao1=document.getElementById('fapiao1');
    fapiao1.style.color='#f60';
    fapiao1.addClass('tab-nav-selected');
  }

  function companyDiv(member_id){
        var dialog = new Dialog('<{link app=aftersales ctl=site_member act=select_billing}>', {
            width: 600,
            height: 800,
            title: '<{t}>纳税人识别码<{/t}>',
            modal: true,
            async: 'ajax',
            asyncOptions: {
                method: 'post',
                data: 'member_id='+member_id,
                onComplete: function() {
                    //onShow();
                }
            }
        });
        closeDiv = function() {
            dialog.hide();
        }
    }

    function orderId(member_id){
      var dialog = new Dialog('<{link app=aftersales ctl=site_member act=select_order}>', {
            width: 700,
            height: 800,
            title: '<{t}>订单信息<{/t}>',
            modal: true,
            async: 'ajax',
            asyncOptions: {
                method: 'post',
                data: 'member_id='+member_id,
                onComplete: function() {
                    onShow();
                }
            }
        });
        closeDiv = function() {
            dialog.hide();
        }

  }
  var companyDivId=document.getElementById("companyDivId").value;
  var submit1 = $('member_prepaid').getElement('button[type=submit]');
  function ajax_callback1(type, msg, url) {
      if(type == 'error') {
          submit1.removeClass('disabled');
      }
      return top.Message( msg, type, function(){
          if(url) location.href = url;
      });
  }

</script>



